class XMLLoader {
  
  DOM.AudioBuffer buffer;
  Function callback;
  
  XMLLoader(String src, Function this.callback)
  {
    loadSound(src);
  }
  
  void loadSound(String url) 
  {
    DOM.XMLHttpRequest request = new DOM.XMLHttpRequest();
    request.open('GET', url, true);
    request.responseType = 'arraybuffer';
 
    request.addEventListener('load', onLoaded);
    
    request.send();
  }
  
  
  void onLoaded(DOM.XMLHttpRequestProgressEvent e)
  {
    DOM.XMLHttpRequest request = e.currentTarget;
    callback(request.response);
  }
}